<?php


namespace App\Http\Controllers\Sale;


use App\Models\Order;
use App\Models\OrderGoods;
use App\Models\OrderLease;
use App\Models\SaleUser;
use App\Models\SaleUserLogin;
use App\Models\SaleLog;
use App\Models\Areas;
use App\Services\CommonService;
use App\Services\ExportService;
use App\Services\OrderService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class OrderExportController extends BaseExportController
// class OrderController
{
    /**
     * 订单列表导出
     * @param Request $request
     * @return false|string
     */
    public function orderListSaleExport(Request $request){
        $sale_user_id = $this->users['sale_user_id'];

        $data = ExportService::adminOrderListSaleExport($request,$sale_user_id);
        if(!$data){
            return ReturnMsg(CommonService::HTTP_CODE_FAIL,'无数据');
        }
        $params = $request->input();
        if(isset($params['order_status']) && $params['order_status']){
            $params['order_status'] = OrderService::ORDER_STATUS_NAME_LIST[$params['order_status']];
        }
        ExportService::exportFile($params,$data,ExportService::FILE_ORDER_SALE_LIST);
    }



}
